package org.finesys.ai.core.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;

import java.util.List;

public class ModelsResponse {

    @JsonProperty("object")
    private String objectName;

    @JsonProperty("data")
    private List<Model> data;

    public ModelsResponse(Builder builder) {
        this.objectName = builder.objectName;
        this.data = builder.data;
    }

    public static ModelsResponse.Builder builder() {
        return new ModelsResponse.Builder();
    }

    @JsonPOJOBuilder(withPrefix = "")
    @JsonIgnoreProperties(ignoreUnknown = true)
    @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
    public static final class Builder {

        private String objectName;

        private List<Model> data;

        private Builder() {
        }

        public ModelsResponse.Builder object(String objectName) {
            this.objectName = objectName;
            return this;
        }

        public ModelsResponse.Builder data(List<Model> data) {
            this.data = data;
            return this;
        }

        public ModelsResponse build() {
            return new ModelsResponse(this);
        }

    }
}
